package edu.uct.tamnd.viettourism.maps;

import java.util.ArrayList;

import org.w3c.dom.Document;

import android.graphics.Color;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.PolylineOptions;

import edu.uct.tamnd.viettourism.R;



public class Maps_Template extends FragmentActivity{

	GoogleMap mMap;
	@Override
	protected void onCreate(Bundle arg0) {
		// TODO Auto-generated method stub
		super.onCreate(arg0);
		setContentView(R.layout.maps);
		
		LatLng src = new LatLng(21.029232,105.855425);
		LatLng des = new LatLng(21.030333,105.782356);
		Direction md = new Direction();
		Document doc = md.getDocument(src, des, Direction.MODE_DRIVING);
		ArrayList<LatLng> directionPoint = md.getDirection(doc);
		PolylineOptions rectLine = new PolylineOptions().width(3).color(Color.RED); // Màu và độ rộng
		for(int i = 0 ; i < directionPoint.size() ; i++) {
		rectLine.add(directionPoint.get(i));
		}
		mMap.addPolyline(rectLine);
	}
		
}
